﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CustomerListPage.aspx.cs" Inherits="masterPages_customer_CustomerListPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<table width="730" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="34" style="background-image:../../images/bj2.gif"><strong>&nbsp;&nbsp;&nbsp;&nbsp;会员列表</strong></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>
          <table width="577" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td>
                  <asp:ImageButton ID="AddCustomerImageButton" runat="server" 
                      ImageUrl="~/images/an8.gif" 
                      PostBackUrl="~/masterPages/customer/AddNewMember.aspx" />
                  &nbsp;&nbsp;&nbsp;&nbsp;
                  <asp:ImageButton ID="DeleteCustomerImageButton" runat="server" 
                      ImageUrl="~/images/an9.gif" onclick="DeleteCustomerImageButton_Click" />
              </td>
            </tr>
            <tr>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>
                <asp:ObjectDataSource ID="SourceCustomer" runat="server" 
                    DataObjectTypeName="CustomerDetail" 
                    DeleteMethod="DeleteEmployees" OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="GetEmployees" TypeName="CustomerDB" 
                    UpdateMethod="UpdateEmployees"></asp:ObjectDataSource>
                <asp:GridView ID="SourceGridView" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" DataSourceID="SourceCustomer" CellPadding="3" 
                      BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" 
                      CellSpacing="2" 
                      onrowcommand="SourceGridView_RowCommand" DataKeyNames="CustomerId">
                    <Columns>
                        <asp:BoundField DataField="CustomerId" HeaderText="CustomerId" 
                            SortExpression="CustomerId" Visible="False" >
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="选择">
                            <EditItemTemplate>
                                <asp:CheckBox ID="DeleteCheckBox" runat="server" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="DeleteCheckBox" runat="server" />
                            </ItemTemplate>
                            <HeaderStyle Width="35px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="Name" HeaderText="姓名" SortExpression="Name">
                            <HeaderStyle Width="65px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="EMail" HeaderText="邮件" SortExpression="EMail">
                            <HeaderStyle Width="180px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Level" HeaderText="等级" SortExpression="Level">
                        <HeaderStyle Width="50px" />
                            </asp:BoundField>
                        <asp:BoundField DataField="Gender" HeaderText="性别" SortExpression="Gender">
                            <HeaderStyle Width="50px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Phone" HeaderText="电话" SortExpression="Phone">
                        <HeaderStyle Width="80px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:LinkButton ID="ModifyLinkButton" runat="server" 
                                    CommandArgument='<%#DataBinder.Eval(Container.DataItem, "CustomerId")%>'
                                    CommandName="ModifyDetail">修改</asp:LinkButton>
                                     | 
                                <asp:LinkButton ID="ViewLinkButton" runat="server" 
                                     CommandArgument='<%#DataBinder.Eval(Container.DataItem, "CustomerId")%>'
                                     CommandName="ViewDetail">查看详情</asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle Width="130px" />
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#FFF1D4" />
                    <SortedAscendingHeaderStyle BackColor="#B95C30" />
                    <SortedDescendingCellStyle BackColor="#F1E5CE" />
                    <SortedDescendingHeaderStyle BackColor="#93451F" />
                </asp:GridView> 
              </td>
            </tr>
            <tr>
              <td>&nbsp;</td>
            </tr>
          </table>
      </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</asp:Content>

